package apiPractice;

public class practice01 {
    public static void main(String[] args) {
        Student s1=new Student("张大喵",25);
        Student s2=new Student("魏大勇",19);
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s1.hashCode());
        System.out.println(s2.hashCode());
        System.out.println(s1.equals(s2));//false
        char[] value={'a','b','c'};
        String S1=new String(value);
        String S2=new String(value);
        String S3="abc";
        String S4="abc";
        String S5="abcd";
        System.out.println(S1 ==S2);//false
        System.out.println(S1 == S2);//false
        System.out.println(S3 == S4);//true
        System.out.println(S1.equals(S3));//true
        System.out.println(S3.equals(S5));//flase

    }
}
class Student{
    String name;
    int age;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}